<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>offSet</title>
	<style>
		*{
			margin: 0px;
		}
		.parent div{
			margin-top:600px;
			color: red;
		}
	</style>
	<script type="text/javascript" src="./lib/jquery.min.js"></script>
</head>
<body>
	<div class="parent">
		<div>测试offset</div>
	</div>
<script>
	//var dv = document.getElementsByTagName('div')[1];
	var dv = $('div:eq(1)');
	console.log(dv.offset());
	dv.click(function(){
		$(this).offset({top:100,left:0});
		console.log($(this).offset());
		console.log($(this).position());
	});
	var pos = dv.position();
	console.log(pos);
	//return;
	//alert(111);
	//var off = dv.offset();
	//console.log(off);
</script>
</body>
</html>